package com.atguigu.spring5.service;

import com.atguigu.spring5.dao.UserDao;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service(value = "userService")
@Data
public class UserService {

    @Value("杨琛")
    private String name;

//    @Autowired
//    @Qualifier("userDaoImpl2")
//    private UserDao userDao;

    @Autowired
    private UserDao userDaoImpl;

    public void add(){
        System.out.println("add方法");
    }

    public void dao(){
        userDaoImpl.show();
        System.out.println(name);
    }
}
